Iterating on data (for)
FOR is the primary construct used for iterating over a collection and its documents. You can use for to iterate over collections and apply filters or additional processing on the data
Basic for
Here is an example of returning any 100 documents
for flight in flights
limit 100
return flightHere is an example of deleting all the documents we created in the scratch collections (the return OLD returns the the deleted documents)
for junk in scratch
remove junk in scratch
return OLD._keyRunning the AQL query again will return an empty list
[]
Help us improve
Anything unclear or buggy in this tutorial? Provide Feedback